var ns;
app = new Vue({
    el: '#app',
    data: {
        paymentId: 0,
        printId:0,
        form: {},
    },
    methods: {
        get_data: function() {
            var that = this;
            var options = {};
            options.action = "getanalysisfeehistorydetaildata";
            options.ID = that.paymentId;
            ns.post(options, function(succeed, data, err) {
                if (succeed) {
                    that.form = data;
                } else if (err) {
                    api.toast({
                        msg: err,
                        duration: 2000,
                        location: 'bottom'
                    });
                }
            }, {
                toast: true
            });
        },
        //查看收据明细
        doOpenDetail:function(){
            var that=this;
            ns.openWin('analysis_historyfeedetail_frm', '收费明细', {
                ID: that.paymentId //账单ID
            })
        },
        //返回
        onReturn:function(){ 
            //关闭应收账单页面
            api.closeWin({
                name: 'chargeroomfee_frm'
            });

            //关闭收费确认页面
            api.closeWin({
                name: 'shoufeipay_frm'
            });
            api.closeWin();  

            // api.closeToWin({
            //     name: 'shoufeiguanli_frm'
            // });
        },
        doOpenPrint: function () {
            var that = this;
            ns.openWin('printInvoice', '打印单据', {
                printId: that.paymentId
            });
        },
    }
});
apiready = function () {
    api.parseTapmode();
    ns = window.Foresight.Util;
    app.paymentId = api.pageParam.paymentId; 
    app.get_data();
};
